package org.itboys.mobile.dto.count;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.math.BigDecimal;
import java.util.List;

/**
 * 作者：jiangxiong
 * 日期：2017年5月8日
 * 描述：圣代_结算实体（购物车实体，只取products）_dto。
 */

public class SundayCountDto {
    @JsonIgnore
    private String title;//订单商品名称合计
    private BigDecimal totalAmount;//应付金额
    private BigDecimal payAmount;//实付金额/实付爱购币
    private Long memberId;//用户Id
    private String idCard;//身份证号
    private String realName;//真是姓名
    private Long shopId;//门店ID。自营为0
    private String shopName;//门店名称
    private String shopImage;//门店头像
    //优惠券信息
    @JsonIgnore
    private Long couponId;//优惠券ID

    private BigDecimal couponAmount;//优惠券金额
    private String couponMsg;//优惠券优惠信息
    //爱购币信息
    private Integer isUseAigou;//是否使用爱购币

    private BigDecimal aiGouTotalCoin;//用户总共爱购币
    private BigDecimal aiGouAbleCoin;//用户本次结算可用的爱购币。按用户等级来。
    private BigDecimal aiGouAbleAmount;//本次用户结算可用爱购币对应的金额
    @JsonIgnore
    private BigDecimal aiGouUsedCoin;//用户本次结算使用的爱购币。按用户等级来。
    @JsonIgnore
    private BigDecimal aiGouUsedAmount;//用户本次结算使用的爱购币对应的金额。

   // private BigDecimal aigouMsg;//爱购币抵扣金额
    //余额信息
    private Integer isUseBalance;//是否余额
    private BigDecimal balanceAbleAmount;//可用余额
    @JsonIgnore
    private BigDecimal balanceUsedAmount;//使用的余额
    //贝壳信息
    private Integer isUseConch;//是否使用贝壳
    private BigDecimal conchAbleAmount;//可用贝壳
    @JsonIgnore
    private BigDecimal conchUsedAmount;//使用的贝壳
    //private BigDecimal balanceMsg;//余额信息
    //运费
    private BigDecimal sendAmount;//运费
    private String sendAmountMsg;//运费说明
    private Integer type;//结算类型 1普通，2新品，3特卖，4全球购，5分销，6爱购币，7积分，8秒杀，9拼团，10试用
    //特殊促销
    private Integer teamIsJoin;//是否拼团
    @JsonIgnore
    private Long teamGroupId;//拼团组ID
    //结算说明
    private String info;//
    //商品
    private List<SundayCountProductDto> products;
    //2018年2月14日
    private Integer sendType;//配送方式 1，门店配送，2自提
    public SundayCountDto() {
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public BigDecimal getTotalAmount() {
        if(totalAmount!=null)totalAmount=totalAmount.setScale(2,BigDecimal.ROUND_HALF_UP);
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getPayAmount() {
        if(payAmount!=null)payAmount=payAmount.setScale(2,BigDecimal.ROUND_HALF_UP);
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopImage() {
        return shopImage;
    }

    public void setShopImage(String shopImage) {
        this.shopImage = shopImage;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public BigDecimal getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(BigDecimal couponAmount) {
        this.couponAmount = couponAmount;
    }

    public String getCouponMsg() {
        return couponMsg;
    }

    public void setCouponMsg(String couponMsg) {
        this.couponMsg = couponMsg;
    }

    public Integer getIsUseAigou() {
        return isUseAigou;
    }

    public void setIsUseAigou(Integer isUseAigou) {
        this.isUseAigou = isUseAigou;
    }

    public BigDecimal getAiGouTotalCoin() {
        return aiGouTotalCoin;
    }

    public void setAiGouTotalCoin(BigDecimal aiGouTotalCoin) {
        this.aiGouTotalCoin = aiGouTotalCoin;
    }

    public BigDecimal getAiGouAbleCoin() {
        if(aiGouAbleCoin!=null)aiGouAbleCoin=aiGouAbleCoin.setScale(2,BigDecimal.ROUND_HALF_UP);
        return aiGouAbleCoin;
    }

    public void setAiGouAbleCoin(BigDecimal aiGouAbleCoin) {
        this.aiGouAbleCoin = aiGouAbleCoin;
    }

    public BigDecimal getAiGouAbleAmount() {
        if(aiGouAbleAmount!=null)aiGouAbleAmount=aiGouAbleAmount.setScale(2,BigDecimal.ROUND_HALF_UP);
        return aiGouAbleAmount;
    }

    public void setAiGouAbleAmount(BigDecimal aiGouAbleAmount) {
        this.aiGouAbleAmount = aiGouAbleAmount;
    }

    public BigDecimal getAiGouUsedCoin() {
        return aiGouUsedCoin;
    }

    public void setAiGouUsedCoin(BigDecimal aiGouUsedCoin) {
        this.aiGouUsedCoin = aiGouUsedCoin;
    }

    public BigDecimal getAiGouUsedAmount() {
        return aiGouUsedAmount;
    }

    public void setAiGouUsedAmount(BigDecimal aiGouUsedAmount) {
        this.aiGouUsedAmount = aiGouUsedAmount;
    }

    public Integer getIsUseBalance() {
        return isUseBalance;
    }

    public void setIsUseBalance(Integer isUseBalance) {
        this.isUseBalance = isUseBalance;
    }

    public BigDecimal getBalanceAbleAmount() {
        if(balanceAbleAmount!=null)balanceAbleAmount=balanceAbleAmount.setScale(2,BigDecimal.ROUND_HALF_UP);
        return balanceAbleAmount;
    }

    public void setBalanceAbleAmount(BigDecimal balanceAbleAmount) {
        this.balanceAbleAmount = balanceAbleAmount;
    }

    public BigDecimal getBalanceUsedAmount() {
        return balanceUsedAmount;
    }

    public void setBalanceUsedAmount(BigDecimal balanceUsedAmount) {
        this.balanceUsedAmount = balanceUsedAmount;
    }

    public Integer getIsUseConch() {
        return isUseConch;
    }

    public void setIsUseConch(Integer isUseConch) {
        this.isUseConch = isUseConch;
    }

    public BigDecimal getConchAbleAmount() {
        return conchAbleAmount;
    }

    public void setConchAbleAmount(BigDecimal conchAbleAmount) {
        this.conchAbleAmount = conchAbleAmount;
    }

    public BigDecimal getConchUsedAmount() {
        return conchUsedAmount;
    }

    public void setConchUsedAmount(BigDecimal conchUsedAmount) {
        this.conchUsedAmount = conchUsedAmount;
    }

    public BigDecimal getSendAmount() {
        return sendAmount;
    }

    public void setSendAmount(BigDecimal sendAmount) {
        this.sendAmount = sendAmount;
    }

    public String getSendAmountMsg() {
        return sendAmountMsg;
    }

    public void setSendAmountMsg(String sendAmountMsg) {
        this.sendAmountMsg = sendAmountMsg;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getTeamIsJoin() {
        return teamIsJoin;
    }

    public void setTeamIsJoin(Integer teamIsJoin) {
        this.teamIsJoin = teamIsJoin;
    }

    public Long getTeamGroupId() {
        return teamGroupId;
    }

    public void setTeamGroupId(Long teamGroupId) {
        this.teamGroupId = teamGroupId;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public List<SundayCountProductDto> getProducts() {
        return products;
    }

    public void setProducts(List<SundayCountProductDto> products) {
        this.products = products;
    }

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public String getEntityInfo(){
        return "结算部分字段说明：totalAmount(应付金额)，payAmount(实付金额)，idCard(身份证号码)，couponMsg（优惠券使用信息），"+
                "isUseAigou(是否使用爱购币.0否默认，1是)，aiGouAbleCoin（可用爱购币），aigouAbleAmount（可用爱购币抵扣金额），"+
                "isUseBalance(是否使用余额.0否默认，1是)，balanceAbleAmount（可用余额）"+
                "sendAmount(运费)，type（结算类型），typeStr(结算类型说明)，teamIsJoin（是否参与拼团，只针对拼团商品）";
    }

    public String  getTypeStr(){
        String typeStr2= "";
        if(type==null)return typeStr2;

        switch (type) {
            case 1:
                typeStr2="普通。允许：加入购车，立即购买";
                break;
            case 2:
                typeStr2="新品。允许：加入购车，立即购买";
                break;
            case 3:
                typeStr2="特卖。允许：加入购车，立即购买";
                break;
            case 4:
                typeStr2="全球购。允许：加入购车，立即购买。";
                break;
            case 5:
                typeStr2="分销。允许：加入购车，立即购买";
                break;
            case 6:
                typeStr2="爱购币。允许：立即购买。显示xx爱购币";
                break;
            case 7:
                typeStr2="积分。允许：立即购买。无此类型";
                break;
            case 8:
                typeStr2="秒杀。允许：立即购买。显示倒计时";
                break;
            case 9:
                typeStr2="拼团。允许：立即购买。显示正在拼团的组；显示拼团价格和正常购买价格";
                break;
            case 10:
                typeStr2="试用。暂无";
                break;
            default:
                break;
        }
        return typeStr2;
    }
}
